package org.feiye.studyday28;

import java.io.*;
import java.net.*;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class Clientside2 {
	public static void main(String[] args) {
		Socket s = null;
		OutputStream o = null;
		InputStream is = null;
		try {
			s = new Socket("192.168.10.93", 8888);
			is = s.getInputStream();
			OutputStream os = s.getOutputStream();
			ObjectInputStream ois = new ObjectInputStream(is);
			ObjectOutputStream oos = new ObjectOutputStream(os);
			Object object = ois.readObject();
			System.out.println(object);
			oos.writeObject("告辞");
			oos.flush();
		} catch (Exception e) {
			e.printStackTrace();
		} finally {
			if (o != null)
				try {
					o.close();
				} catch (IOException e) {
					e.printStackTrace();
				}
			if (s != null)
				try {
					s.close();
				} catch (IOException e) {
					e.printStackTrace();
				}
			if (is != null)
				try {
					is.close();
				} catch (IOException e) {
					e.printStackTrace();
				}
		}
	}
}
